Explictly terminate buffer in skyforce to avoid uninitialized buffer walk.
authorrobertl <robertl>
Fri, 31 Oct 2008 12:42:16 +0000 (12:42 +0000)
committerrobertl <robertl>
Fri, 31 Oct 2008 12:42:16 +0000 (12:42 +0000)
skyforce.c

index 910f2636bff89df71d30bc9ee458e017e8d92b61..6d6cf3746674d36b1a5fab3f363d48ebb7a08c52 100644 (file)
@@ -93,6 +93,7 @@ skyforce_parse_trk(const char *str)
 
        memset(&tm, 0, sizeof(tm));
        strncpy(buf, str + 2, sizeof(buf) - 1);
+        buf[14] = 0;
 
        cx = strptime(buf, "%d%m%y  %H%M%S ", &tm);
        if ((cx != NULL) && (*cx != '\0'))